Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto-search completion script in ARGC_COMPLETIONS_PATH #264

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Nov 11, 2023

When run argc --argc-compgen bash '' mycmd '' without setting the argcfile(the fourth argument), argc will automatically search for the script file at $ARGC_COMPLETIONS_PATH.

This can reduce the difficulty of using argc as a completion engine.

Users now can create a my-completions-dir directory and then place argc-based completion scripts within that directory.
Use the following code to autoload the completion scripts in the directory.

export ARGC_COMPLETIONS_PATH=my-completions-dir
eval <(ls -1 my-completions-dir | sed -n 's/\.sh$//p' | xargs argc --argc-completions bash)

@sigoden sigoden merged commit 37a6be7 into main Nov 12, 2023
3 checks passed
@sigoden sigoden deleted the feat-compgen branch November 12, 2023 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant